package com.tedu.spring.example;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestUser {
    public static void main(String[] args) {
         /*
            1.由框架创建Spring bean对象,并存入IoC容器中;
            2.从IoC容器中获取Spring bean对象;
            3.调用Java对象的方法测试;

            复制路径快捷键：
            * 复制：Ctrl + Shift + Alt + c
                   Fn + Ctrl + Shift + Alt + c
            * 粘贴：Ctrl + v
         */
        ApplicationContext context = new AnnotationConfigApplicationContext("com.tedu.spring.example");
        //context.getBean(User.class).var
        User user = context.getBean(User.class);
        user.run();
    }
}
